// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   HomeController.java

package com.nervytech.tutorcruise.spring.controller;

import com.nervytech.tutorcruise.spring.common.form.RegistrationForm;
import com.nervytech.tutorcruise.spring.security.auth.UserDetailsServiceImpl;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping({ "/usr/home", "/pub/home" })
public class HomeController {

	@RequestMapping(method = RequestMethod.GET)
	public String showHome(Map model) {
		if (UserDetailsServiceImpl.currentUserDetails() == null) {
			RegistrationForm regForm = new RegistrationForm();
			regForm.setFrmOrigin("home");
			model.put("registrationForm", regForm);
			return "home";
		} else {
			return "redirect:/usr/profile";
		}
	}
}
